คำตอบที่ได้รับเลือกจากเจ้าของกระทู้
ความคิดเห็นที่ 4
อ่ารู้แล้วครับ เกิดจาก echo $this->table->generate($data); ใน controller ตรง ๆ ครับ
ถ้า echo ตรงนี้จะแสดงผลก่อน show->view เสมอครับ ขอบคุณทุคำตอบครับ


ถ้า echo ตรงนี้จะแสดงผลก่อน show->view เสมอครับ ขอบคุณทุคำตอบครับ



▼ กำลังโหลดข้อมูล... ▼
แสดงความคิดเห็น
คุณสามารถแสดงความคิดเห็นกับกระทู้นี้ได้ด้วยการเข้าสู่ระบบ
codeigniter ง่าทำไม table มันไปอยู่บน header หละครับ
เป็นเพราะอะไรครับ งงตึ๊บ
public function show_registered(){
$this->load->database();
$this->load->helper('form');
$this->load->helper('url');
$this->load->library('table');
$this->load->helper('html');
$this->load->view('template/header');
$query = $this->db->get('registered');
$data = array();
$data[] = array('ลำดับที่','ภาพถ่าย');
foreach($query->result() as $row){
$image_properties = array(
'src' => $row->photo,
'width' => '180',
'height' => '120',
);
$data[] = array($row->id,img($image_properties));
}
echo $this->table->generate($data);
$this->load->view('template/footer');
}